import { Component, OnInit, Inject } from '@angular/core'
import { STColumn } from '@delon/abc'
import { NzMessageService } from 'ng-zorro-antd'

import { ListBaseClass } from '@shared/classes/ListBaseClass'
import { Settlement, ISettlementQueryParams } from '@shared/interfaces/store'
import { I18NService } from '@core'
import { PageService } from '@shared/services/page.service'
import { ActivatedRoute, Router } from '@angular/router'
import { ETabScrollStatus } from '@shared/enums'
import { DataService } from '@shared/services/data.service'

@Component({
  selector: 'app-merchant-detail-tab-settlement',
  templateUrl: './tab-settlement.component.html',
  styles: []
})
export class MerchantDetailTabSettlementComponent extends ListBaseClass<Settlement, ISettlementQueryParams> implements OnInit {
  columns: STColumn[] = [
    {
      title: '报表代码',
      i18n: '报表代码',
      index: 'merNum',
      width: 80,
      className: 'text-left',
    },
    {
      title: '报表名称',
      i18n: '报表名称',
      index: 'merName',
      className: 'text-left',
    },
    {
      title: '报表类型',
      i18n: '报表类型',
      index: 'merNameEN',
      className: 'text-left',
    },
    {
      title: '文件格式',
      i18n: '文件格式',
      index: 'createdAt',
      className: 'text-center',
    },
    {
      title: '报表层级',
      i18n: '报表层级',
      index: 'format',
      className: 'text-left'
    },
  ]
  constructor(
    public msg: NzMessageService,
    public i18n: I18NService,
    public route: ActivatedRoute,
    public router: Router,
    private dataService: DataService,
    private pageService: PageService
  ) {
    super(msg, i18n, route, router)
  }

  ngOnInit() {
    // Phrase Two
    this.dataService.merchant$.value$.subscribe(merchant => {
      this.pageService.setTabScrollStatus(ETabScrollStatus.Scroll)
    })
  }
}
